<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
    <style type="text/css">
        a {
            text-decoration: none;
            display: block;
            line-height: 30px;
            padding-left: 20px;
            color: #fff;
        }
        ul {
            width: 30%;
            min-width: 150px;
            max-width: 240px;
            height: 600px;
            display: block;
            padding-top: 30px;
            background: #333;
            margin: 0;
            float: left;
        }
        li {
            list-style: none;
            width: 120px;
            height: 30px;
            border: 1px solid #ccc;
            margin-top: 10px;
        }
        .li {
            background:#fff;
            color:#333;
        }
        .container {
            float: left;
            width: 70%;
            height: 600px;
            padding-top: 30px;
            background: #ccc;
        }

        .iframe {
            width: inherit;
            height: inherit;
            border-style: none;
        }

    </style>
    <script type="text/javascript">
        var selectedLi;

        function change(page) {
            if (selectedLi == null) {
                selectedLi = page;
                selectedLi.className = null;
            } else {
                selectedLi.className = null;
                selectedLi = page;
            }
            page.className = "li";
            // 在同一目录下 创建1.html 2.html 3.html 取消注释下面的iframe 可使用此方法进行切换
            // document.getElementById('content').src = page.rel+".html";
            document.getElementById('container').innerHTML = "#######" + page.rel;

        }

    </script>
</head>

<body>
<ul id="menu">
    <li><a onclick="change(this)" href="javascript:;" rel="1" class="li">标签1</a></li>
    <li><a onclick="change(this)" href="javascript:;" rel="2">标签2</a></li>
    <li><a onclick="change(this)" href="javascript:;" rel="3">标签3</a></li>
</ul>
<div id="container" class="container">
    #######1
    <!-- <iframe id="content" class="iframe" src="#"></iframe> -->
</div>
<script type="text/javascript">
    var ul = document.getElementById("menu");
    var li = ul.getElementsByTagName("li")[0];
    selectedLi = li.getElementsByTagName("a")[0];
</script>
</body>
</html>